﻿namespace Infrastructure
{
    /// <summary>
    /// 创建继承sql仓储
    /// </summary>
    public class BaseSqlRepository
    {
        #region 表Sys_user

        /// <summary>
        /// sys_user新增
        /// </summary>
        public static string sysUser_insertSql = @"insert into Sys_User (UserId,UserName ,CorporationKey,Password ,Age,Sex,IsOpen,DepartmentId,CreateTime,CreateUser) values(@UserId,@UserName ,@CorporationKey,@Password ,@Age,@Sex,@IsOpen,@DepartmentId,@CreateTime,@CreateUser)";

        /// <summary>
        /// sys_user更新
        /// </summary>
        public static string sysUser_updateSql = @"update Sys_User set UserId=@UserId,CorporationKey=@CorporationKey,UserName=@UserName ,Password=@Password ,Age=@Age,Sex=@Sex,DepartmentId=@DepartmentId where UserId = @UserId";

        /// <summary>
        /// sys_user查询
        /// </summary>
        public static string sysUser_selectByKeySql = @" select * from Sys_User where  UserId=@Key";

        /// <summary>
        /// sys_user表查询全部语句
        /// </summary>
        public static string sysUser_selectAllSql = @" select * from Sys_User";

        #endregion

        #region 表Sys_Menu

        /// <summary>
        /// Menu查询全部
        /// </summary>
        public static string sysMenu_selectAllSql = @" select Id,CorporationKey,SystemKey,Path,MenuIcon,Name,Pid,IsOpen,Sort,CreateTime,CreateUser,Component,RequireAuth,Redirect from Sys_Menu";

        /// <summary>
        /// 表Sys_Menu查询
        /// </summary>
        public static string sysMenu_selectByKeySql = @" select * from Sys_Menu where  Id=@Key";

        #endregion

        #region 表Sys_Role

        /// <summary>
        /// Sys_Role新增
        /// </summary>
        public static string sysRole_insertSql = @"insert into Sys_Role (Pid ,CorporationKey,SystemKey,RoleName ,RoleType,IsOpen,CreateTime,CreateUser) values(@Pid ,@CorporationKey,@SystemKey,@RoleName ,@RoleType,@IsOpen,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_Role更新
        /// </summary>
        public static string sysRole_updateSql = @"update Sys_Role set Pid=@Pid,CorporationKey=@CorporationKey,SystemKey=@SystemKey,RoleName=@RoleName ,RoleType=@RoleType ,IsOpen=@IsOpen where RoleId = @RoleId";

        /// <summary>
        /// Sys_Role查询
        /// </summary>
        public static string sysRole_selectByKeySql = @" select * from Sys_Role where  RoleId=@Key";

        /// <summary>
        /// Sys_Role表查询全部语句
        /// </summary>
        public static string sysRole_selectAllSql = @" select * from Sys_Role";

        #endregion

        #region 表Sys_Corporation

        /// <summary>
        /// Sys_Corporation新增
        /// </summary>
        public static string sysCorporation_insertSql = @"insert into Sys_Corporation (CorporationKey,CorporationName ,CorporationCode,Remark,IsOpen,CreateTime,CreateUser) values(@CorporationKey,@CorporationName,@CorporationCode,@Remark,@IsOpen ,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_Corporation更新
        /// </summary>
        public static string sysCorporation_updateSql = @"update Sys_Corporation set CorporationKey=@CorporationKey,CorporationName=@CorporationName,CorporationCode=@CorporationCode,Remark=@Remark,IsOpen=@IsOpen where CorporationKey = @CorporationKey";

        /// <summary>
        /// Sys_Corporation查询
        /// </summary>
        public static string sysCorporation_selectByKeySql = @" select * from Sys_Corporation where  CorporationKey=@Key ";

        /// <summary>
        /// Sys_Corporation表查询全部语句
        /// </summary>
        public static string sysCorporation_selectAllSql = @" select * from Sys_Corporation";

        #endregion

        #region 表Sys_System

        /// <summary>
        /// Sys_System新增
        /// </summary>
        public static string sysSystem_insertSql = @"insert into Sys_System (SystemKey,CorporationKey,SystemName,SystemCode,IsOpen,Remark,CreateTime,CreateUser) values(@SystemKey,@CorporationKey,@SystemName,@SystemCode,@IsOpen,@Remark ,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_System更新
        /// </summary>
        public static string sysSystem_updateSql = @"update Sys_System set SystemKey=@SystemKey,IsOpen=@IsOpen,CorporationKey=@CorporationKey,SystemName=@SystemName,SystemCode=@SystemCode,Remark=@Remark where SystemKey = @SystemKey";

        /// <summary>
        /// Sys_System查询
        /// </summary>
        public static string sysSystem_selectByKeySql = @" select * from Sys_System where  SystemKey=@Key ";

        /// <summary>
        /// Sys_System表查询全部语句
        /// </summary>
        public static string sysSystem_selectAllSql = @" select * from Sys_System";

        #endregion

        #region 表Sys_Department

        /// <summary>
        /// Sys_System新增
        /// </summary>
        public static string sysDepartment_insertSql = @"insert into Sys_Department (Id,CorporationKey,DepartmentName,Pid,Sort,CreateTime,CreateUser) values(@Id,@CorporationKey,@DepartmentName,@Pid,@Sort ,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_Department更新
        /// </summary>
        public static string sysDepartment_updateSql = @"update Sys_Department set CorporationKey=@CorporationKey,DepartmentName=@DepartmentName,Pid=@Pid,Sort=@Sort where Id = @Id";

        /// <summary>
        /// Sys_Department查询
        /// </summary>
        public static string sysDepartment_selectByKeySql = @" select * from Sys_Department where  Id=@Key";

        /// <summary>
        /// Sys_Department表查询全部语句
        /// </summary>
        public static string sysDepartment_selectAllSql = @" select * from Sys_Department";

        #endregion

        #region 表Sys_ExceptionLog

        /// <summary>
        /// Sys_ExceptionLog新增
        /// </summary>
        public static string sysExceptionLog_insertSql = @"insert into Sys_ExceptionLog (CorporationKey,SystemKey,ExceptionType,ExceptionMsg,ExceptionTime,OperateUserName,OperateUserId,IsHandle,HandleUserName,HandleUserId) values(@CorporationKey,@SystemKey,@ExceptionType,@ExceptionMsg,@ExceptionTime,@OperateUserName,@OperateUserId,@IsHandle,@HandleUserName,@HandleUserId)";

        /// <summary>
        /// Sys_ExceptionLog查询
        /// </summary>
        public static string sysExceptionLog_selectByKeySql = @" select * from Sys_ExceptionLog where  Id=@Key";

        /// <summary>
        /// Sys_ExceptionLog表查询全部语句
        /// </summary>
        public static string sysExceptionLog_selectAllSql = @" select * from Sys_ExceptionLog";

        #endregion

        #region 表Sys_LoginLog

        /// <summary>
        /// Sys_LoginLog新增
        /// </summary>
        public static string sysLoginLog_insertSql = @"insert into Sys_LoginLog (Id,CorporationKey,UserId,Ip,Country,Prov,City,Area,Isp,Lng,Lat,CreateTime,CreateUser) values(@Id,@CorporationKey,@UserId,@Ip,@Country,@Prov,@City,@Area,@Isp,@Lng,@Lat,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_LoginLog查询
        /// </summary>
        public static string sysLoginLog_selectByKeySql = @" select * from Sys_LoginLog where  Id=@Key";

        /// <summary>
        /// Sys_LoginLog表查询全部语句
        /// </summary>
        public static string sysLoginLog_selectAllSql = @" select * from Sys_LoginLog";

        #endregion

        #region 表Sys_MenuRoleRelation

        /// <summary>
        /// Sys_MenuRoleRelation新增
        /// </summary>
        public static string sysMenuRoleRelation_insertSql = @"insert into Sys_MenuRoleRelation (MenuId,RoleId,IsHalfSelected,CreateTime,CreateUser) values(@MenuId,@RoleId,@IsHalfSelected,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_MenuRoleRelation更新
        /// </summary>
        public static string sysMenuRoleRelation_updateSql = @"update Sys_MenuRoleRelation set MenuId=@MenuId,RoleId=@RoleId,IsHalfSelected=@IsHalfSelected,CreateTime=@CreateTime,CreateUser=@CreateUser where MenuRoleId = @MenuRoleId";

        /// <summary>
        /// Sys_MenuRoleRelation查询
        /// </summary>
        public static string sysMenuRoleRelation_selectByKeySql = @" select * from Sys_MenuRoleRelation where  MenuRoleId=@Key";

        /// <summary>
        /// Sys_MenuRoleRelation表查询全部语句
        /// </summary>
        public static string sysMenuRoleRelation_selectAllSql = @" select * from Sys_MenuRoleRelation";

        #endregion

        #region 表Sys_UserRoleRelation

        /// <summary>
        /// Sys_UserRoleRelation新增
        /// </summary>
        public static string sysUserRoleRelation_insertSql = @"insert into Sys_UserRoleRelation (RoleId,UserId,CreateTime,CreateUser) values(@RoleId,@UserId,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_UserRoleRelation更新
        /// </summary>
        public static string sysUserRoleRelation_updateSql = @"update Sys_UserRoleRelation set RoleId=@RoleId,UserId=@UserId,CreateTime=@CreateTime,CreateUser=@CreateUser where UserRoleId = @UserRoleId";

        /// <summary>
        /// Sys_UserRoleRelation查询
        /// </summary>
        public static string sysUserRoleRelation_selectByKeySql = @" select * from Sys_UserRoleRelation where  UserRoleId=@Key";

        /// <summary>
        /// Sys_UserRoleRelation表查询全部语句
        /// </summary>
        public static string sysUserRoleRelation_selectAllSql = @" select * from Sys_UserRoleRelation";

        #endregion

        #region 表Sys_Button

        /// <summary>
        /// Sys_Button新增
        /// </summary>
        public static string sysButton_insertSql = @"insert into Sys_Button (ButtonId,ButtonRoleType,ButtonName,CorporationKey,SystemKey,ButtonKey,ButtonStyleId,RuleId,MenuId,OrderBy,CreateTime,CreateUser) values(@ButtonId,@ButtonRoleType,@ButtonName,@CorporationKey,@SystemKey,@ButtonKey,@ButtonStyleId,@RuleId,@MenuId,@OrderBy,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_Button更新
        /// </summary>
        public static string sysButton_updateSql = @"update Sys_Button set ButtonRoleType=@ButtonRoleType,ButtonName=@ButtonName,ButtonKey=@ButtonKey,CorporationKey=@CorporationKey,SystemKey=@SystemKey,ButtonStyleId=@ButtonStyleId,RuleId=@RuleId,MenuId=@MenuId,OrderBy=@OrderBy,CreateTime=@CreateTime,CreateUser=@CreateUser where ButtonId = @ButtonId";

        /// <summary>
        /// Sys_Button查询
        /// </summary>
        public static string sysButton_selectByKeySql = @" select * from Sys_Button where  ButtonId=@Key";

        /// <summary>
        /// Sys_Button表查询全部语句
        /// </summary>
        public static string sysButton_selectAllSql = @" select * from Sys_Button";

        #endregion

        #region 表Sys_ButtonStyle

        /// <summary>
        /// Sys_ButtonStyle新增
        /// </summary>
        public static string sysButtonStyle_insertSql = @"insert into Sys_ButtonStyle (ButtonStyleId,ButtonStyleName,Size,[Types],Icon,Color,TextColor,IsText,IsRound,IsPlain,IsLink,IsCircle,IsDisabled,OrderBy,CreateTime, CreateUser) values(@ButtonStyleId,@ButtonStyleName,@Size,@Types,@Icon,@Color,@TextColor,@IsText,@IsRound,@IsPlain,@IsLink,@IsCircle,@IsDisabled,@OrderBy,@CreateTime, @CreateUser)";

        /// <summary>
        /// Sys_ButtonStyle更新
        /// </summary>
        public static string sysButtonStyle_updateSql = @"update Sys_ButtonStyle set ButtonStyleName=@ButtonStyleName,Size=@Size,[Types]=Types,Icon=@Icon,Color=@Color,TextColor=@TextColor,IsText=@IsText,IsRound=@IsRound,IsPlain=@IsPlain,IsLink=@IsLink,IsCircle=@IsCircle,IsDisabled=@IsDisabled,OrderBy=@OrderBy,CreateTime=@CreateTime, CreateUser=@CreateUser where ButtonStyleId = @ButtonStyleId";

        /// <summary>
        /// Sys_ButtonStyle查询
        /// </summary>
        public static string sysButtonStyle_selectByKeySql = @" select * from Sys_ButtonStyle where  ButtonStyleId=@Key";

        /// <summary>
        /// Sys_ButtonStyle表查询全部语句
        /// </summary>
        public static string sysButtonStyle_selectAllSql = @" select * from Sys_ButtonStyle";

        /// <summary>
        /// Sys_ButtonStyle 删除
        /// </summary>
        public static string sysButtonStyle_delete = @" delete from  Sys_ButtonStyle where ButtonStyleId=@Key";

        #endregion

        #region 表 Sys_ButtonRole

        /// <summary>
        /// Sys_ButtonRole 新增
        /// </summary>
        public static string sysButtonRole_insertSql = @"insert into Sys_ButtonRole (ButtonRoleId,MenuId,ButtonId,RoleId,CreateTime,CreateUser) values(@ButtonRoleId,@MenuId,@ButtonId,@RoleId,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_ButtonRole 更新
        /// </summary>
        public static string sysButtonRole_updateSql = @"update Sys_ButtonRole set MenuId=@MenuId,ButtonId=@ButtonId,RoleId=@RoleId,CreateTime=@CreateTime,CreateUser=@CreateUser where ButtonRoleId = @ButtonRoleId";

        /// <summary>
        /// Sys_ButtonRole 查询
        /// </summary>
        public static string sysButtonRole_selectByKeySql = @" select * from Sys_ButtonRole where  ButtonRoleId=@Key";

        /// <summary>
        /// Sys_ButtonRole 表查询全部语句
        /// </summary>
        public static string sysButtonRole_selectAllSql = @" select * from Sys_ButtonRole";

        #endregion

        #region 表Sys_DataRule

        /// <summary>
        /// Sys_DataRule新增
        /// </summary>
        public static string sysDataRule_insertSql = @"insert into Sys_DataRule (RuleId ,RuleName,CorporationKey,SystemKey,MenuId,RuleType,RuleJson,AnalysisRule,AnalysisRule_CN,IsOpen,Remark,Sort,CreateTime,CreateUser) values(@RuleId ,@RuleName,@CorporationKey,@SystemKey,@MenuId,@RuleType,@RuleJson,@AnalysisRule,@AnalysisRule_CN,@IsOpen,@Remark,@Sort,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_DataRule更新
        /// </summary>
        public static string sysDataRule_updateSql = @"update Sys_DataRule set RuleName=@RuleName,CorporationKey=@CorporationKey,SystemKey=@SystemKey,MenuId=@MenuId,RuleType=@RuleType ,RuleJson=@RuleJson,AnalysisRule=@AnalysisRule,AnalysisRule_CN=@AnalysisRule_CN ,IsOpen=@IsOpen ,Remark=@Remark, Sort=@Sort where RuleId = @RuleId";

        /// <summary>
        /// Sys_DataRule查询
        /// </summary>
        public static string sysDataRule_selectByKeySql = @" select * from Sys_DataRule where  RuleId=@Key";

        /// <summary>
        /// Sys_DataRule表查询全部语句
        /// </summary>
        public static string sysDataRule_selectAllSql = @" select * from Sys_DataRule";

        #endregion

        #region 表Sys_MenuTableCols

        /// <summary>
        /// Sys_MenuTableCols新增
        /// </summary>
        public static string sysMenuTableCols_insertSql = @"insert into Sys_MenuTableCols (FieldId ,CorporationKey,SystemKey,MenuId,FieldType,FieldEnName,FieldCnName,FieldWidth,FieldFixed,FieldSortable,FieldAlign,FieldOrderBy,CreateTime,CreateUser) values(@FieldId ,@CorporationKey,@SystemKey,@MenuId,@FieldType,@FieldEnName,@FieldCnName,@FieldWidth,@FieldFixed,@FieldSortable,@FieldAlign,@FieldOrderBy,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_MenuTableCols更新
        /// </summary>
        public static string sysMenuTableCols_updateSql = @"update Sys_MenuTableCols set CorporationKey=@CorporationKey,SystemKey=@SystemKey,MenuId=@MenuId,FieldType=@FieldType,FieldEnName=@FieldEnName,FieldCnName=@FieldCnName,FieldWidth=@FieldWidth,FieldFixed=@FieldFixed,FieldSortable=@FieldSortable,FieldAlign=@FieldAlign,FieldOrderBy=@FieldOrderBy where RuleId = @RuleId";

        /// <summary>
        /// Sys_MenuTableCols查询
        /// </summary>
        public static string sysMenuTableCols_selectByKeySql = @" select * from Sys_MenuTableCols where  FieldId=@Key";

        /// <summary>
        /// Sys_MenuTableCols表查询全部语句
        /// </summary>
        public static string sysMenuTableCols_selectAllSql = @" select * from Sys_MenuTableCols";

        #endregion

        #region 表Sys_DataRuleConfig

        /// <summary>
        /// Sys_DataRuleConfig新增
        /// </summary>
        public static string sysDataRuleConfig_insertSql = @"insert into Sys_DataRuleConfig (ConfigType,MenuId,PermissionsField,PermissionsFieldName,ConditionalEquationValue,ShowControl,ShowControlDataSource,IsOpen,CreateTime,CreateUser) values(@ConfigType,@MenuId,@PermissionsField,@PermissionsFieldName,@ConditionalEquationValue,@ShowControl,@ShowControlDataSource,@IsOpen,@CreateTime,@CreateUser)";

        /// <summary>
        /// Sys_DataRuleConfig更新
        /// </summary>
        public static string sysDataRuleConfig_updateSql = @"update Sys_DataRuleConfig set ConfigType=@ConfigType,MenuId=@MenuId,PermissionsField=@PermissionsField,PermissionsFieldName=@PermissionsFieldName,ConditionalEquationValue=@ConditionalEquationValue,ShowControl=@ShowControl,ShowControlDataSource=@ShowControlDataSource,IsOpen=@IsOpen where ConfigId = @ConfigId";

        /// <summary>
        /// Sys_DataRuleConfig查询
        /// </summary>
        public static string sysDataRuleConfig_selectByKeySql = @" select * from Sys_DataRuleConfig where  ConfigId=@Key";

        /// <summary>
        /// Sys_DataRuleConfig表查询全部语句
        /// </summary>
        public static string sysDataRuleConfig_selectAllSql = @" select * from Sys_DataRuleConfig";

        #endregion
    }
}
